package com.qfedu.mesadmin.dev.mainn.controller;

import com.qfedu.mes.common.CommonResult;
import com.qfedu.mes.common.PageVO;
import com.qfedu.mes.entity.dev.MainProject;
import com.qfedu.mesadmin.dev.mainn.params.SearchParam;
import com.qfedu.mesadmin.dev.mainn.service.MainProjectService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.naming.CompositeName;

@RestController
@RequestMapping("/main/pro")
public class MainProjectController {
    @Resource
    private MainProjectService mainProjectService;
    @GetMapping("/page")
    public CommonResult pageList(SearchParam param){
        PageVO<MainProject> pageVO = mainProjectService.pageList(param);
        return CommonResult.success(pageVO);
    }

    @PostMapping("/add")
    public CommonResult addMainProject(@RequestBody MainProject project){
        mainProjectService.addMainProject(project);
        return CommonResult.success();
    }
}
